package com.reremouse.rerebbs.web.mb;

import com.reremouse.model.AdvModel;
import com.reremouse.rerebbs.dao.IAdvDAO;
import com.reremouse.util.SpringHelper;

import javax.annotation.PostConstruct;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import java.io.Serializable;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@ManagedBean
@RequestScoped
public class Adv
        implements Serializable {
    IAdvDAO advDAO = (IAdvDAO) SpringHelper.getSpringBean("AdvDAO");
    Map advsMap = new HashMap();

    public Map getAdvsMap() {
        return this.advsMap;
    }

    public void setAdvsMap(Map advsMap) {
        this.advsMap = advsMap;
    }

    @PostConstruct
    public void init() {
        List<AdvModel> advs = this.advDAO.findAllAdv();
        for (AdvModel a : advs) {
            this.advsMap.put(Long.valueOf(a.getId()), a);
        }
    }
}



/* Location:           F:\jsp源码\蝙蝠论坛系统\rerebbs\WEB-INF\classes\

 * Qualified Name:     com.reremouse.rerebbs.web.mb.Adv

 * JD-Core Version:    0.7.0.1

 */